import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Login',
      component: () => import('../views/Login.vue'),
    },
    {
      path: '/Main',
      name: 'Main',
      component: () => import('../views/Main.vue'),
      children: [
        {
          path: '/GoodsView',
          name: 'GoodsView',
          component: () => import('../views/GoodsView.vue'),
        },
        {
          path: '/detail',
          name: 'detail',
          component: () => import('../views/detail.vue'),
        },
        //测试
        {
          path: '/Code',
          name: 'Code',
          component: () => import('../views/Code.vue'),
        },
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
